#include "accountloginrequest.h"
#include "accountloginresponse.h"
#include "network/networkjsonresponse.h"
#include <json.h>

#include <QDebug>
#include <QUrl>
#include <QTextStream>
#include "common/defines.h"

namespace Account {

LoginRequest::LoginRequest(const QString &user, const QString &password, QObject *parent) :
    Network::GetJSONRequest(parent),
    m_user(user),
    m_password(password),
    m_response(new LoginResponse())
{
}

QUrl LoginRequest::url() const
{
    QString url = QString(REST_LOGIN_REQUEST).arg(m_user, m_password);
    //qDebug() << "Login Request Url:";
    //qDebug() << url;
    return QUrl(url);
}

Network::JSONResponse &LoginRequest::jsonResponse()
{
    return *m_response;
}

const Network::JSONResponse &LoginRequest::jsonResponse() const
{
    return *m_response;
}

}
